package com.chen.Sign.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chen.Sign.pojo.Blog;
import com.chen.Sign.mapper.BlogMapper;
import com.chen.Sign.service.BlogService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@SuppressWarnings({"all"})
public class BlogServiceImpl extends ServiceImpl<BlogMapper, Blog> implements BlogService {

    @Autowired
    BlogMapper blogMapper;


    public boolean writerBlog(Blog blog) {
        int x = blogMapper.insertBlog(blog);
        if (x > 0) {
            return true;
        } else {
            return false;
        }
    }

    public boolean updateviews(@Param("views") Integer views,@Param("id") Integer id) {
        int addviews = blogMapper.addviews(views, id);
        if (addviews > 0) {
            return true;
        } else {
            return false;
        }
    }
}
